Networks facilitate the exchange of information between applications running on different computers. Computers with applications that share data with other computers are used pervasively in both personal and business settings. As a result, networks are now widely used in both homes and offices to transmit many types of information.
Information sent over a network is traditionally formatted in packets. Each packet contains a header with routing information, which allows network devices to process the packet so that it reaches its intended destination. Each packet is traditionally formatted according to a protocol, which specifies what routing information is included the header and how network devices respond to that information. For example, a protocol may specify that a device receiving a packet generate an acknowledgement message so that the device sending the packet learns that the packet was received.
Multiple layers of routing information are needed to provide sufficient information for all network devices to route information from an application on one computer to an application on another computer. At the highest interconnection layer, a specific application on a computerized device must be specified. At the lowest layer, each computerized device is connected to a local network and has an address on that local network, which must also be specified. A middle layer is also required because networks may be formed from interconnected local networks, and information must be specified to allow information to be routed from one local network to another. These layers may be called, from highest to lowest, a connection or application layer (depending on the protocol), a path layer and a link layer.
A network will frequently operate according to a layered protocol, with each layer being a protocol that specifies processing of a packet, or other interactions, appropriate for one interconnection layer. For example, a widely used layered protocol is the TCP/IP/ARP layered protocol. TCP is a protocol used at the connection layer. IP is a protocol used at a path layer, and ARP is a protocol used at the link layer.
In many computers, a network stack formats information and performs other processing required to comply with a layered protocol. The network stack frequently is part of the computer's operating system and contains a number of software modules, each performing processing appropriate for one protocol layer.
To ensure that information is properly transmitted over a network, the network stack manages the process of transmitting a packet, including compensating for errors. For example, if the network stack attempts to transmit a packet and does not receive an acknowledgement within a timeout period, the network stack may make another attempt to transmit the message. The network stack may make multiple attempts to transmit a packet until successful or until it eventually reports to the application attempting to send information that the transmission failed.
A network stack may also select transmission parameters to increase the likelihood that a packet reaches it destination. For example, in a computer that has multiple “gateways” to a network through which packets could be sent, a network stack may select a gateway for transmission of a packet deemed best for transmission of the packet. The gateway could be selected based on information about whether packets with similar addresses had been previously routed successfully through that gateway.
Information specifying which gateways had been previously used for transmission to specific destination addresses is stored in a routing table. The routing table stores, for prior successful transmissions, the destination address and the gateway used. As each new packet is transmitted, a routing module within the network stack selects an entry in the routing table, which specifies a gateway through which that packet is transmitted.
Selection of an entry in a routing table may be based on multiple criteria. One criteria is the closeness of the match between an address in the routing table and the destination address in that packet to be transmitted. Matching is performed based on the number of identical bits in the prefixes of the addresses being compared. If no address in the routing table matches any prefix bits of the destination address in a packet, the network stack transmits the packet through a “default gateway.”
To avoid attempting to transmit packets through a gateway that could not support communication, the status of the default gateway may be monitored. In the MICROSOFT WINDOWS XP® operating system, the network stack classifies the default gateway as “dead” if 75% of the transmissions over connections that use the default gateway fail. When the default gateway is classified as “dead,” it is not used for further transmissions. If another gateway is classified as “live,” the live gateway is used. However, if there is no “live” gateway, the transmission fails.